home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / MantAirBall.swf / scripts / frame_17 / PlaceObject2_10_20 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2005-08-05  |  1.6 KB  |  83 lines

  1. onClipEvent(enterFrame){
  2.    if(this._x < _root._xmouse && _root._xmouse - this._x < 70)
  3.    {
  4.       xmove = true;
  5.    }
  6.    if(this._x > _root._xmouse && _root._xmouse - this._x > -70)
  7.    {
  8.       xmove = true;
  9.    }
  10.    if(this._y - _root._ymouse > -100 && this._y - _root._ymouse < 0)
  11.    {
  12.       ymove = true;
  13.    }
  14.    if(yspeed < _root.gravity && this._y <= base)
  15.    {
  16.       yspeed += 0.5;
  17.    }
  18.    if(this._y + yspeed <= base)
  19.    {
  20.       this._y += yspeed;
  21.    }
  22.    else
  23.    {
  24.       this._y = base;
  25.       yspeed = - yspeed / bounce;
  26.    }
  27.    if(_root.increasethrust == true)
  28.    {
  29.       if(xmove == true && ymove == true)
  30.       {
  31.          xspeed -= (_root._xmouse - this._x) / weight;
  32.          yspeed -= (100 - (this._y - _root._ymouse)) / weight;
  33.          scoredistance = _root._xmouse;
  34.       }
  35.    }
  36.    if(this._y > base)
  37.    {
  38.       this._y = base;
  39.    }
  40.    if(this._x + xspeed < rw)
  41.    {
  42.       this._x += xspeed;
  43.    }
  44.    else
  45.    {
  46.       this._x = rw;
  47.       xspeed = - xspeed / bounce;
  48.    }
  49.    if(this._x + xspeed > lw)
  50.    {
  51.       this._x += xspeed;
  52.    }
  53.    else
  54.    {
  55.       this._x = lw;
  56.       xspeed = - xspeed / bounce;
  57.    }
  58.    this._rotation += xspeed * 3;
  59.    _root.ypos = this._y;
  60.    _root.yspeed = yspeed;
  61.    _root.xspeed = xspeed;
  62.    if(xmove == false)
  63.    {
  64.       if(xspeed < 0)
  65.       {
  66.          xspeed += 0.005;
  67.       }
  68.       if(xspeed > 0)
  69.       {
  70.          xspeed -= 0.005;
  71.       }
  72.       if(_root.increasethrust == false)
  73.       {
  74.          if(xspeed > -0.25 and xspeed < 0.25)
  75.          {
  76.             xspeed = 0;
  77.          }
  78.       }
  79.    }
  80.    xmove = false;
  81.    ymove = false;
  82. }
  83.